package com.phiture.erp.produce.dal.mapper;

import java.util.*;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.phiture.erp.produce.dal.entity.ErpProduceInDO;
import com.phiture.erp.produce.dal.entity.ErpProductionTaskDO;
import com.phiture.erp.produce.dal.pojo.vo.ErpProduceInRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 生产入库-包含成品，半成品 Mapper
 *
 * @author lekaihuai
 */
@Mapper
public interface ErpProduceInMapper extends BaseMapperX<ErpProduceInDO> {

    default int updateByIdAndStatus(Long id, Integer status, ErpProduceInDO updateObj) {
        return update(updateObj, new LambdaUpdateWrapper<ErpProduceInDO>()
                .eq(ErpProduceInDO::getId, id).eq(ErpProduceInDO::getStatus, status));
    }

    IPage<ErpProduceInRespVO> selectMyPage(
            IPage<ErpProduceInRespVO> page,
            @Param("produceInNo") String produceInNo,
            @Param("materialName") String materialName,
            @Param("status") Integer status,
            @Param("tenantId") Long tenantId
    );

}